﻿using MinorAspNetCore.Server;
using System.Threading.Tasks;

namespace MinorAspNetCore
{
    public interface IMinorWebHost
    {
        Task StartAsync();
    }

    public class MinorWebHost : IMinorWebHost
    {
        private readonly IServer _server;
        private readonly RequestDelegate _handler;

        public MinorWebHost(IServer server, RequestDelegate handler)
        {
            _server = server;
            _handler = handler;
        }

        public Task StartAsync() => _server.StartAsync(_handler);
    }
}